
const myMethods = {
    hello(){
        console.log('hello xmut')
    },
    hello2(){
        console.log('hello xmut 17 soft')
    },
    toast(msg,type){
        let strType = "success"
        switch(type){
            case 1:
                strType = "success"
                break
            case 2:
                strType = "error"
                msg = "用户名或密码错误"
                break
            case 3:
                strType = "warning"
                msg = "权限不足"
                break
            case 4:
                strType = "warning"
                msg = "该账号已存在"
                break
            case 5:
                strType = "warning"
                msg = "该课程类型已存在"
                break
            case 6:
                strType = "warning"
                msg = "您的账号未启用或被禁止使用，具体原因请联系管理员"
                break
            case 7:
                strType = "error"
                msg = "信息错误，修改失败"
                break
            case 8:
                    strType = "warning"
                    msg = "评论不能为空"
                    break
            case 9:
                    strType = "warning"
                    msg = "评分不能为空"
                    break
            case 10:
                    strType = "warning"
                    break
            case 11:
                    strType = "error"
                    break
            default:
                strType = "success"
        }
        this.$message({
            message: msg,
            type: strType,
            showClose: true,
            duration: 2000
        })
    },
    navigator(url){
        this.$router.push(url)
    },
    navigateBack(){
        this.$router.go(-1)
    },
    clone(obj) {
        return JSON.parse(JSON.stringify(obj))
      }
}

export default{
    data(){
        return{
            myProject:'xmut 的项目'
        }
    },
    methods: {
        ...myMethods
    }
}